package com.springboot.gateway.elasticSearch.doc;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

//文档映射-就是把domain映射到索引库中文档
@Document(indexName = "sys",type = "employee")
@Data
public class Employee{

    @Id
    private Long id; //唯一标识
    @Field(type = FieldType.Keyword) //不分词文本
    private String name; //名称
    private Integer age; //年龄
    @Field(type = FieldType.Text) //分词文本
    private String intro; //简介

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word") //分词文本
    private String all;
    
}
